<?php

/**
 * AbetStudiedCourse form base class.
 *
 * @method AbetStudiedCourse getObject() Returns the current form's model object
 *
 * @package    sfproject
 * @subpackage form
 * @author     Your name here
 */
abstract class BaseAbetStudiedCourseForm extends BaseFormPropel
{
  public function setup()
  {
    $this->setWidgets(array(
      'abet_plan_study_id' => new sfWidgetFormPropelChoice(array('model' => 'AbetPlanStudy', 'add_empty' => true)),
      'abet_student_id'    => new sfWidgetFormPropelChoice(array('model' => 'AbetStudent', 'add_empty' => true)),
      'mark'               => new sfWidgetFormInputHidden(),
      'letter_grade'       => new sfWidgetFormInputText(),
      'created_at'         => new sfWidgetFormDateTime(),
      'updated_at'         => new sfWidgetFormDateTime(),
    ));

    $this->setValidators(array(
      'abet_plan_study_id' => new sfValidatorPropelChoice(array('model' => 'AbetPlanStudy', 'column' => 'id', 'required' => false)),
      'abet_student_id'    => new sfValidatorPropelChoice(array('model' => 'AbetStudent', 'column' => 'id', 'required' => false)),
      'mark'               => new sfValidatorChoice(array('choices' => array($this->getObject()->getMark()), 'empty_value' => $this->getObject()->getMark(), 'required' => false)),
      'letter_grade'       => new sfValidatorString(array('max_length' => 2, 'required' => false)),
      'created_at'         => new sfValidatorDateTime(array('required' => false)),
      'updated_at'         => new sfValidatorDateTime(array('required' => false)),
    ));

    $this->widgetSchema->setNameFormat('abet_studied_course[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'AbetStudiedCourse';
  }


}
